module.exports=function(acc,err){
//导入mongoose
const mongoose=require('mongoose')
//导入数据库的端口号
const config=require('../config/config.js')
mongoose.set('strictQuery',true)
//连接数据库
mongoose.connect(`mongodb://${config.address}:${config.port}/${config.dbName}`)
//回调函数
mongoose.connection.once('open',()=>{
	acc()
})
mongoose.connection.on('error',()=>{
	err()
})
mongoose.connection.on('error',()=>{
	console.log('连接出错')
})
}